<?php
/*
 * Created on Oct 12, 2009
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
?>
<script type="text/javascript">
$(document).ready(function() {
	//$("#icon_img").select_image('document_img', {fck_editor_url: '<?=site_url()?>'});
});
</script>
<form action="<?=site_url(array('c' => 'cms_download','m' => 'edit_document', 'id' => $document['id']))?>" method="post" id="documentForm">
<table class="form-table" cellpadding="5" cellspacing="0" style="width: 100%;">
	<tbody>
		<tr>
			<th>Title: </th>
	    	<td class=""><input type="text" name="document_name" class="input-text required" value="<?=$document['name']?>"></td>
	    </tr>
		<tr>
	    	<th>Group: </th>
	    	<td>
				<select name="document_gid" class="input-text">
					<option value="">Please select</option>
					<?php foreach($groups as $item):?>
					<option value="<?=$item['id']?>" <?= $item['id']==$document['gid']? 'selected' : '';?>>
						<?=$item['name']?>
					</option>
					<?php endforeach;?>
				</select>
			</td>
	    </tr>
	    <tr>
			<th>File Upload: </th>
	    	<td><input type="file" id="fileUpload1" name="fileupload1" class="input-text" value="" size="36"/></td>
	    </tr>
	    <tr>
	    	<th>Description: </th>
	    	<td><textarea name="document_description" rows="7" cols="37" class="input-textarea"><?=$document['description']?></textarea></td>
	    </tr>
        <tr>
	        <th>Publish ?: </th>
	        <td>
	        	<input type="radio" name="item_publish" value="0" <?=$document['publish'] == 0?'checked':''?>>Yes
				<input type="radio" name="item_publish" value="1" <?=$document['publish'] == 1?'checked':''?>>No
	        </td>
		</tr>
        <tr>
	        <th>Sort: </th>
	        <td><input type="text" name="document_sort" class="input-text required" value="<?=$document['sort']?>"></td>
		</tr>
	</tbody>
</table>
</form>
